UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+t1fROnm4Wg2YelDXc6q0EA9RM2FfUYRpZZ8cv+BO1M=' 
WHERE 
  key_id = '67b8fc5dbb058589fa9f9d783c2b6e3fbb2e9ba47838189c47d28ed61a22c7b9' 
  AND (
    token = '+t1fROnm4Wg2YelDXc6q0EA9RM2FfUYRpZZ8cv+BO1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034