UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGIpxNyurGlfeLT2XGgyz9JXWP/jLJE0xpmSWAZftpo='
WHERE
key_id = 'a1e170a34568a8d2de899df5396f260a48ff3af8ddf95a7c8a513120be3a78ce'
AND (
token = 'fGIpxNyurGlfeLT2XGgyz9JXWP/jLJE0xpmSWAZftpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)