UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lE/21X+UG1q+LAz02cf+ACQoCu1b62I7bT7VfKrbPCw=' 
WHERE 
  key_id = 'd3a998cad3bdaf542c8ac12e4e16bbd13b5f55a9797890ad55ba12554f78a644' 
  AND (
    token = 'lE/21X+UG1q+LAz02cf+ACQoCu1b62I7bT7VfKrbPCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024