UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUHDz9cD2u/EmzSdlugTvcgSn5UMKAjxDlk5186c/P8=' 
WHERE 
  key_id = '8bcfb5dbd5e1742717096feea9ccd3b4f81a03312be26ad10334253d2d871c45' 
  AND (
    token = 'EUHDz9cD2u/EmzSdlugTvcgSn5UMKAjxDlk5186c/P8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030