UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yk9j+pDp5pB4D2u2JvUe7AgLHb/babW1TUT3HDor4ys='
WHERE
key_id = '5c0aaeaa2ae99fae567e081771455c499874f30f0478c5d6d29af8546e207a4a'
AND (
token = 'Yk9j+pDp5pB4D2u2JvUe7AgLHb/babW1TUT3HDor4ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)