UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2dSK+xGI5veApht5EFEU9fyDtLv3rSk9z2TQjDhlyZI='
WHERE
key_id = 'd980cc3eca6cc86c34a43e014cb35fca0be65d2f1e2d48d1efa2bd12b2fdd969'
AND (
token = '2dSK+xGI5veApht5EFEU9fyDtLv3rSk9z2TQjDhlyZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)