UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z1WsxaVisT+U4Ze359usxywNcm1BLoLAY31mV7IWo9w=' 
WHERE 
  key_id = '5908e97d3deead1980d1a2e933e09b7faa204c36b2fc966bbd3eb02069f4e6b1' 
  AND (
    token = 'Z1WsxaVisT+U4Ze359usxywNcm1BLoLAY31mV7IWo9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035