UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wp5EqhOMJyDUu7p660XPfZ5OgfB1S7zYF6AQc11kxjc='
WHERE
key_id = 'ee51d3d428d4fa3bcd75fbaa549032eb2dc352901e2fe7e0dda3812dbe34fdb3'
AND (
token = 'wp5EqhOMJyDUu7p660XPfZ5OgfB1S7zYF6AQc11kxjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)