UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8wxpx8oZYp+O4nvvpi3yp/rjdfdjxPR8VKFaplzmZQI='
WHERE
key_id = 'e25b31b7189e7fa8be550aead7898925bd1d5382a92265bafc78b6192d781415'
AND (
token = '8wxpx8oZYp+O4nvvpi3yp/rjdfdjxPR8VKFaplzmZQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)