UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VjDEcWzp3fHK0+zy908XZ8xktq2ntJZqUiDY84PDcQc='
WHERE
key_id = 'b3316a4d2d589af687d16fdddf5722c61073bda7cfaeb8d7e5aef3b65dcda73b'
AND (
token = 'VjDEcWzp3fHK0+zy908XZ8xktq2ntJZqUiDY84PDcQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)