UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eyBr05M54s+Yr5rscHbVy6zdHtW4EHRY0TfYt0eTjUQ=' 
WHERE 
  key_id = '24adeba8d71b53c380edf14fc3e56581e8d5cc2c111bd00e1efc0609c662c856' 
  AND (
    token = 'eyBr05M54s+Yr5rscHbVy6zdHtW4EHRY0TfYt0eTjUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034