UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IOfsfAT6wqjbHkOu5frD/IrA6Metfbc51A4CTpM6hMQ=' 
WHERE 
  key_id = '631a5fff76ddffdbcbfdfcc6051eb480d8d0a329e41d7e9687d439beb9074c76' 
  AND (
    token = 'IOfsfAT6wqjbHkOu5frD/IrA6Metfbc51A4CTpM6hMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024