UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SU2U5LqbSjgtGK64p+vYJVZwYGl+0RQ5jLSjpF4HGYg='
WHERE
key_id = 'c445652e97959e8f1e417ce3f6cde9a2eb7509ac7bcad13816ca3fbde5a5a595'
AND (
token = 'SU2U5LqbSjgtGK64p+vYJVZwYGl+0RQ5jLSjpF4HGYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)