UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oLUmhAZBIKX1K2dncOsGOjdMcwjvwyeXpI9ZhnTe/0='
WHERE
key_id = '12ce9dff9c9bad2da10a773054567245de432432bdf7e7fe67d28560ec4bb720'
AND (
token = '0oLUmhAZBIKX1K2dncOsGOjdMcwjvwyeXpI9ZhnTe/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)