UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0k4x62p2Yi3irvLcctMnieT872nKtY5n4Ium7keVuhE=' 
WHERE 
  key_id = 'b7f9702c5b66771eea6e8d8bbd56c0b632eeced35e02ad364c64840d728d1f3c' 
  AND (
    token = '0k4x62p2Yi3irvLcctMnieT872nKtY5n4Ium7keVuhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029