UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0WRN2iJy+I49zIjADbhGpDK9/AHzQZTZxhs+p6/flbg='
WHERE
key_id = 'b2eef21d74ec6fc4a15e8790a389bb46e4bc1644742593019e0b755e5cbccdc1'
AND (
token = '0WRN2iJy+I49zIjADbhGpDK9/AHzQZTZxhs+p6/flbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)