UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y2Jmp75D0fBr71yW75ZX3MvlDK6PKiD1L2iMTi6p6bo=' 
WHERE 
  key_id = 'a39622ae7facdf6a8de3ac51a64ab2cc285e78a5012a5c81272c4c7e5e728092' 
  AND (
    token = 'y2Jmp75D0fBr71yW75ZX3MvlDK6PKiD1L2iMTi6p6bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034