UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iOd6kaQaf9/pCugRX8lxsg70d79r/CvYbiiH2znEzy8=' 
WHERE 
  key_id = '885cb5690b6d6b138674f09659023704ab723e27a1c483d8bff18bd2808998f3' 
  AND (
    token = 'iOd6kaQaf9/pCugRX8lxsg70d79r/CvYbiiH2znEzy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060