UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EfecAQ7aVuqkZ9nLpoeKGE5RZ1Uw/u4QO38Ke3Wh4YI=' 
WHERE 
  key_id = 'ae48e7eed6f2b6503689ee455e7ac7d1ebdeb928eab1a41c30431a1146b558b9' 
  AND (
    token = 'EfecAQ7aVuqkZ9nLpoeKGE5RZ1Uw/u4QO38Ke3Wh4YI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033