UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3CJIHcpARvzz9hl1ftJKc50jLT/c37Nn8uXnYIyAYKE='
WHERE
key_id = '4a5431ed72093204fb08b4e6cc530ef6fd5da636c3d929afe355bcf44328d212'
AND (
token = '3CJIHcpARvzz9hl1ftJKc50jLT/c37Nn8uXnYIyAYKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)