UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fpSBDpOgvzZYNzWdrEwSZ8Xqt8YG2QPaTSb2+B8Hir0='
WHERE
key_id = '456320be4ce53182e0b7350cbe07a4931c0bb8d0de15895b02ae032f847f027c'
AND (
token = 'fpSBDpOgvzZYNzWdrEwSZ8Xqt8YG2QPaTSb2+B8Hir0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)