UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IzAx6iNE9U8J4IzmG2ZIFNTj/Fv9l23PD0o7tjNKuTI='
WHERE
key_id = 'c03ae930de40391038857180df1d341de01f4cbe7ec2234f53f64ea9746f76bc'
AND (
token = 'IzAx6iNE9U8J4IzmG2ZIFNTj/Fv9l23PD0o7tjNKuTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)