UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CIX8YvR7701uz0+wB13CFWNA9aZ7L9QnlBhMES6CzB8=' 
WHERE 
  key_id = 'a5a58fd914f6c6ba97d9ba43569fcb02f67b39e38d133d7a1408c1c190a2897f' 
  AND (
    token = 'CIX8YvR7701uz0+wB13CFWNA9aZ7L9QnlBhMES6CzB8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033