UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Q8CjrMTu4q+a2cNuR5HfN/tCke21NHDSIPKLz7ZqEQ='
WHERE
key_id = 'ccabc1e96733355158e84ebf2122cc729d99cf35258f4d3beedda357a0012059'
AND (
token = '4Q8CjrMTu4q+a2cNuR5HfN/tCke21NHDSIPKLz7ZqEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)