UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SWTKZ8QLnohg3YIMv8g2y0pARTdeo9TP/u5Qa2fjL8c=' 
WHERE 
  key_id = '1ae02e8d9616da75ed5cac37e26dfd1d961b2dca4cc64c95ab43428e31bd3509' 
  AND (
    token = 'SWTKZ8QLnohg3YIMv8g2y0pARTdeo9TP/u5Qa2fjL8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034