UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tjOFZsjABWlFkw76K831yM1MzKwblUVzwnMr5vlCCyc='
WHERE
key_id = 'f187c3ddee0d5908df7e1d963142b97528afdba43fcef475ea3a53e0111306b5'
AND (
token = 'tjOFZsjABWlFkw76K831yM1MzKwblUVzwnMr5vlCCyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)