UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M6gsauOqalcG9hslnbeSVUUiaxS3sZS2fFUO4pVg4OQ=' 
WHERE 
  key_id = '2c4ed55ac37921d9fa9dff10d4874fa4c39d60dafd5c11a135848f03e8b213c6' 
  AND (
    token = 'M6gsauOqalcG9hslnbeSVUUiaxS3sZS2fFUO4pVg4OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043