UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGoZt6UDNnuTglCw7gDHvgB/3vH4PMSTGWjbiua5xwE='
WHERE
key_id = 'b0be3c0e73d1cf09a3d6adf2295f4fe2213a98b9dd352480e95ede49402745ae'
AND (
token = 'UGoZt6UDNnuTglCw7gDHvgB/3vH4PMSTGWjbiua5xwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)