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