UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wlOb0kYJWMFHn1+gTeilIA+EMVlbMqwQI+yJHzgSGsI='
WHERE
key_id = 'c67aa91c26e0b552ec7e9a8cae87da3ed48cdcab91c37927616df78b300cad5f'
AND (
token = 'wlOb0kYJWMFHn1+gTeilIA+EMVlbMqwQI+yJHzgSGsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)