UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2MdQU/WirGpz/85wuPVzP48hclrNpqIVHeP0e6ZyfJ8='
WHERE
key_id = 'a91116e9fdfce065577f8da898a41ee8c80eb88a228b4f09b8b41833c05ff9a3'
AND (
token = '2MdQU/WirGpz/85wuPVzP48hclrNpqIVHeP0e6ZyfJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)