UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3qg2FonJxGSCmbj6YUwsK//UZxclQn9Ro9xleaTMAwk='
WHERE
key_id = 'e9818c723c8ce19c35073be8128d66b53df180fe217f83778984b00f077dbfed'
AND (
token = '3qg2FonJxGSCmbj6YUwsK//UZxclQn9Ro9xleaTMAwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)